//
//  LoginTableViewCell.m
//  NewMusic
//
//  Created by dllo on 15/11/12.
//  Copyright © 2015年 Going. All rights reserved.
//

#import "LoginTableViewCell.h"

@implementation LoginTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        [self creatSubView];
    }
    return self;
}
- (void)creatSubView
{
    self.contentView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:[[NSBundle mainBundle] pathForResource:@"loginCell" ofType:@"png"]]];
    // 创建登陆字体
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(30, 10, 220, 40)];
    label.text = @"登陆享特权, 高质量音乐等你下";
    label.textColor = [UIColor whiteColor];
    label.font = [UIFont systemFontOfSize:15.0];
    [self.contentView addSubview:label];
    [label release];
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(270, 15, 80, 30);
    [button setTitle:@"立即登陆" forState:UIControlStateNormal];
    button.backgroundColor = [UIColor colorWithRed:38 / 255.0 green:185 / 255.0 blue:100 / 255.0 alpha:1.0];
    button.layer.cornerRadius = 6;
    button.titleLabel.font = [UIFont systemFontOfSize:14.0];
    [button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:button];
    
}
- (void)buttonAction:(UIButton *)sender
{
    [self.delegate changeViewInLoginCell];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
